import Vue from 'vue'
import VueRouter from 'vue-router'
import VueResource from 'vue-resource'
import App from './App'
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css';

import Hello from './components/Hello.vue'
import Movie from './components/Movie.vue'
import Online from './components/Online.vue'
import Me from './components/Me.vue'

import {Indicator} from 'mint-ui'

document.documentElement.webkitRequestFullScreen()

Vue.use(VueRouter);
Vue.use(VueResource);
Vue.use(MintUI);

Vue.http.interceptors.push(function(request, next) {
    console.log('loading');
    Indicator.open({
        text: 'loading...',
        spinnerType: 'double-bounce'
    });
    next(function(response) {
        console.log('loaded');
        Indicator.close();
    });
})

var router = new VueRouter({
    history: true
});

router.map({
    '/movie': {
        component: Hello
    },
    '/order': {
        component: Movie
    },
    '/found': {
        component: Online
    },
    '/me': {
        component: Me
    },

});
router.redirect({
    '/': '/movie'
});
router.start(App, '#asd');

